home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 5082 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.7 KB

  1. Path: news.lpr.carel.fi!usenet
  2. From: Ari Lukumies <aril@cmt.lpr.mail.carel.fi>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: ODBC in Console Applicatoin ?
  5. Date: Fri, 02 Feb 1996 14:25:05 +0200
  6. Organization: Carelcomp Forest
  7. Message-ID: <311202A1.6F84@cmt.lpr.mail.carel.fi>
  8. References: <3110A77A.47EC@hobbe.adb.gu.se>
  9. NNTP-Posting-Host: renoir.cclahti.carel.fi
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0b6a (WinNT; I)
  14.  
  15. Peter Bohn wrote:
  16. > Hello !!!
  17. > I've created an application with the AppsWizard and linked a *.mdb file
  18. > to it. I used MFC to managed that. But the question is, can I get access
  19. > to a *.mdb file and use the MFC in a console application?
  20.  
  21. Actually, you don't _link_ the mdb file to your application (it's an external 
  22. datafile); you use ODBC API calls like SQLDriverConnect etc. to connect to it from your 
  23. code, SQLPrepare, SQLExecute etc. to execute SQL statments and the like. Or, using MFC, 
  24. you use the classes CDatabase, CRecordSet etc. and communicate with the database with 
  25. those.
  26.  
  27. > My goal is to take variables from a WWW-page and put it in a Access
  28. > Database(*.mdb). But another problem is, there is no stdout in the
  29. > application AppsWizard created for me. I have to work with windows, and
  30. > therefore I must use a console application.
  31. > Is this impossible ?
  32.  
  33. I think, if you use ODBC API calls, that can be done. But if you use MFC (wrapper above 
  34. ODBC API calls), you'll have to stick to GUI applications. If I remember correctly, 
  35. MFC's CDatabase refuses to open a database (that mdb file) if there is no graphical 
  36. parent window present.
  37.  
  38. Later,
  39.  AriL
  40. -- 
  41. All my opinions are mine and mine alone.
  42.